/*
 * Context.h
 *
 *  Created on: Apr 29, 2012
 *      Author: kobe
 */

#ifndef CONTEXT_H_
#define CONTEXT_H_

#include <vector>
#include <string>

#include "Proposition.h"
#include "Agent.h"

enum ContextItem {
	CONTEXT_PROPOSITION = 0,
	PROPOSITIONCONTEXT = 1,
	CONTEXT_ACTION = 2,
	ACTIONCONTEXT = 3,
	ACTIONANNOTATEDCONTEXT = 4
};

class Context {
public:
	Context(std::string);
	Context(Proposition*);
	Context();
	Context(ContextItem);
	std::string toString();
	virtual ~Context();
	bool isAnnotated();
    std::vector<Context*> getItemList() const;
    Proposition *getProposition() const;
    ContextItem getType() const;
    void setItemList(std::vector<Context*> itemList);
    void setProposition(Proposition *proposition);
    void setType(ContextItem type);
    std::vector<Agent*> getAgentList() const;
    void setAgentList(std::vector<Agent*> agentList);
    std::string toLatex();
    Context *getParent() const;
    void setParent(Context *parent);
    std::vector<Context*> getActionList() const;
    void setActionList(std::vector<Context*> actionList);
    bool compare(Context*);
private:
	Context* getContext(std::string*, size_t*);
	bool isActionContext();
	Proposition* mProposition;
	std::vector<Context*> mItemList;
	std::vector<Agent*> mAgentList;
	ContextItem mType;
	bool isOnlyAnnotatedContext(std::string input);
	Context* mParent;
	std::vector<Context*> mActionList;
};

#endif /* CONTEXT_H_ */
